1 using UnityEngine;
2
3 namespace
ProceduralToolkit.Examples.Primitives
4 {
5     
[RequireComponent(typeof(MeshRenderer), typeof(MeshFilter))]
6     
public class Plane : MonoBehaviour
7     {
8         
public float xSize = 1f;
9         
public float zSize = 1f;
10         
public int xSegments = 16;
11         
public int zSegments = 16;
12
13         
private void Start()
14         {
15             GetComponent<MeshFilter>().mesh = MeshE.Plane(xSize, zSize, xSegments, zSegments);
16         }
17     }
18 }


Gõ tìm kiếm nhanh...